package cn.ac.jaas.isc.vegetable.quartz.controller;

import cn.ac.jaas.isc.vegetable.common.core.util.R;
import cn.ac.jaas.isc.vegetable.quartz.entity.SysJobLog;
import cn.ac.jaas.isc.vegetable.quartz.service.SysJobLogService;
import com.baomidou.mybatisplus.core.toolkit.Wrappers;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.AllArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @author 张高昌
 * @date 2022/4/30 17:17
 * @description: 定时任务执行日志表
 */
@RestController
@AllArgsConstructor
@RequestMapping("/sys-job-log")
@Api(value = "sys-job-log", tags = "定时任务日志")
public class SysJobLogController {

    private final SysJobLogService sysJobLogService;

    /**
     * 分页查询
     *
     * @param page      分页对象
     * @param sysJobLog 定时任务执行日志表
     * @return
     */
    @GetMapping("/page")
    @ApiOperation(value = "分页定时任务日志查询")
    public R getSysJobLogPage(Page page, SysJobLog sysJobLog) {
        return R.ok(sysJobLogService.page(page, Wrappers.query(sysJobLog)));
    }
}
